<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page isELIgnored="false" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>账号管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">账户名称</div>
                    <div class="field">
                        <input name="accNm1" id="accNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">账号</div>
                    <div class="field">
                        <input name="accNo" id="accNo" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="field">
                        <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>


<script type="text/javascript">
    var grid = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/system/sysBkAccInfo/initList.do?isValid=1',
            method: 'get',
            columns: [
                {display: '开户行', name: 'bkNm', minWidth: 150},
                {display: '账户名称', name: 'accNm', minWidth: 150},
                {display: '账号', name: 'accNo', minWidth: 50},
                {display: '账号类型', name: 'accTypNm', minWidth: 50},
                {display: '选择', minWidth: 50,
                    render: function (rowdata, rowindex, value){
                        var h='<a onclick="choose(\''+rowdata.accNo+'\',\''+rowdata.accNm+'\');"></i>选择</a>'
                        return h;
                    }
                },
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            allowUnSelectRow: true,
            alternatingRow: false
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        $("#searchBtn").click(function (event) {
            var form = new liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });


    });

    function choose(accNo,accNm){
        parent.$("#acceptCode").val(accNo);
        parent.$("#acceptName").val(accNm);
        frameElement.dialog.close();
    }

</script>

</body>
</html>